//
//  SPUserInfoViewController.m
//  Sport
//
//  Created by Cass on 2018/3/24.
//  Copyright © 2018年 Cass. All rights reserved.
//

#import "SPUserInfoViewController.h"

@interface SPUserInfoViewController ()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UITextField *nameText;
@property (weak, nonatomic) IBOutlet UITextView *persignatureText;
@property (weak, nonatomic) IBOutlet UILabel *genderLabel;
@property (weak, nonatomic) IBOutlet UILabel *ageLabel;
@property (weak, nonatomic) IBOutlet UILabel *hobbyLabel;
@property (weak, nonatomic) IBOutlet UILabel *locationLabel;
@property (weak, nonatomic) IBOutlet UILabel *occupationLabel;
@property (weak, nonatomic) UILabel *placeHolderLabel;
@end

@implementation SPUserInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.persignatureText.delegate = self;
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, 150, 21)];
    label.text = @"写签名";
    label.textColor = [UIColor grayColor];
    self.placeHolderLabel = label;
    [self.persignatureText addSubview:label];
}
- (IBAction)back:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (IBAction)genderBtnClick:(id)sender {
    
}

- (IBAction)ageBtnClick:(id)sender {
}

- (IBAction)hobbyBtnClick:(id)sender {
}

- (IBAction)locationBtnClick:(id)sender {
}

- (IBAction)occupationBtnClick:(id)sender {
}

- (IBAction)submitBtnClick:(id)sender {
}

#pragma mark -- UITextViewDelegate --
- (void)textViewDidChange:(UITextView *)textView{
    if (textView.text.length > 0) {
        self.placeHolderLabel.hidden = YES;
    }else{
        self.placeHolderLabel.hidden = NO;
    }
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
    if ([text isEqualToString:@"\n"]) {
        [self.persignatureText resignFirstResponder];
        return NO;
    }
    return YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    }


@end
